/* TableDemo3.java 
* Created on Dec 19, 2012 
* Author:Mr.Viet
* Phone: 01683430426
* Email: phamvanvietcdhd@gmail.com
*/ 
package com.session5; 

import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;

public class TableDemo3 extends AbstracFrame{
	private JTable tblStudent;
	private DefaultTableModel model;
	public TableDemo3() {
		this.model = new DefaultTableModel();
		this.model.addColumn("Std Name");
		this.model.addColumn("Address");
		this.model.addColumn("Age");
		
		this.model.addRow(new String[]{"NgocNV","HN","30"});
		this.model.addRow(new String[]{"NgocNV","HN","30"});
		this.model.addRow(new String[]{"NgocNV","HN","30"});
		this.model.addRow(new String[]{"NgocNV","HN","30"});
		
	}
	@Override
	public void createForm() {
		this.tblStudent = new JTable(this.model);
		this.getContentPane().add(new JScrollPane(this.tblStudent));
	}
	public static void main(String[] args) {
		TableDemo3 f = new TableDemo3();
		f.createForm();
		f.showForm();
	}
}
